

package com.yungu.swift.admin.route.helper;

import com.yungu.swift.assets.driver.model.dto.CarDto;
import com.yungu.swift.assets.driver.model.dto.CarModelDto;
import com.yungu.swift.assets.driver.model.dto.DriverDto;
import com.yungu.swift.system.sys.model.dto.SysBusinessDto;
import com.yungu.swift.system.sys.model.dto.SysCityDto;
import com.yungu.swift.system.sys.model.dto.SysCompanyDto;
import com.yungu.swift.system.sys.model.dto.SysRegionalAgentDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author Zerrion
 * @version 1.0
 * @description 用于获取数据集的工具类
 * @date 2017/10/28 13:15
 */
@Component
public class DataListHelper {

    private static DataMiddleware dataMiddleware;

    /**
     * 用于存储车辆级别类型的map 键值对方式如 2舒适型:carLevelDto
     */
    public static Map<String, CarModelDto> getCarLevelName2BeanMap() {
        return dataMiddleware.getCarLevelName2BeanMap();
    }

    /**
     * 代理信息 键值对  name:agentDto
     */
    public static Map<String, SysRegionalAgentDto> getAgentName2BeanMap() {
        return dataMiddleware.getAgentName2BeanMap();
    }

    /**
     * 公司信息 键值对  shortName|fullName:companyDto
     */
    public static Map<String, SysCompanyDto> getCompanyName2BeanMap() {
        return dataMiddleware.getCompanyName2BeanMap();
    }

    /**
     * 获取车辆表中的全部车牌号 plateNum:carDto
     */
    public static Map<String, CarDto> getCarPlateNum2BeanMap() {
        return dataMiddleware.getCarPlateNum2BeanMap();
    }

    /**
     * 根据车辆类型获取车辆表中的车牌号 plateNum:uuid
     */
    public static Map<String, String> getCarPlateNumMapByType(Map paramsMap) {
        return dataMiddleware.getCarPlateNumMapByType(paramsMap);
    }

    /**
     * 获取车辆表中的全部车牌号
     */
    public static Set<String> getCarPlateNumSet() {
        return dataMiddleware.getCarPlateNumSet();
    }

    /**
     * 获取司机表中的全部车牌号
     */
    public static Set<String> getDriverPlateNumSet() {
        return dataMiddleware.getDriverPlateNumSet();
    }

    /**
     * 获取司机表中的  mobile:driverDto
     */
    public static Map<String, DriverDto> getDriverMobile2BeanMap() {
        return dataMiddleware.getDriverMobile2BeanMap();
    }

    /**
     * 获取司机表中的  idCard:driverDto
     */
    public static Map<String, DriverDto> getDriverIdCard2BeanMap() {
        return dataMiddleware.getDriverIdCard2BeanMap();
    }

    /**
     * 获取司机表中的  mobile:uuid
     */
    public static Map<String, String> getDriverMobileAndIdCard2UuidMap() {
        return dataMiddleware.getDriverMobileAndIdCard2UuidMap();
    }


    /**
     * 获取车辆表中的  plateNum:uuid
     */
    public static Map<String, String> getCarPlateNum2UuidMap() {
        return dataMiddleware.getCarPlateNum2UuidMap();
    }

    /**
     * 获取平台的开通城市中的  cityName:uuid
     */
    public static Map<String, String> getCityName2UuidMap(String appid) {
        return dataMiddleware.getCityName2UuidMap(appid);
    }

    public static Map<String, List<SysBusinessDto>> getOrgUuid_ListBusMap(String appid) {
        return dataMiddleware.getOrgUuid_ListBusMap(appid);
    }

    @Autowired
    public void setDataMiddleware(DataMiddleware dataMiddleware) {
        DataListHelper.dataMiddleware = dataMiddleware;
    }
}
